﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>创建NetFrameworkWeb项目</title>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCore.css" />
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreEclipse.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
    <h3>创建NetFrameworkWeb项目</h3>
    <b>1.安装NFinal.Web nuget包</b><br />
    <b>2.配置Starup类</b><br />
    <pre class="brush: csharp">
        using Owin;
        using Microsoft.Owin.Extensions;

        public class Startup
        {
            public void Configuration(IAppBuilder appBuilder)
            {
                appBuilder.Use&lt;NFinal.Middleware.OwinMiddleware>();
                appBuilder.UseStaticFiles();
                appBuilder.UseStageMarker(PipelineStage.Authenticate);
            }
        }
    </pre>
    <b>3.修改Web.Config,</b><br />
    添加runAllManagedModulesForAllRequests,允许自定义Middleware<br/>
    <pre class="brush:xml;">
        &lt;configuration>
            &lt;system.webServer>
                &lt;modules runAllManagedModulesForAllRequests="true">
                &lt;/modules>
            &lt;/system.webServer>
        &lt;/configuration>
    </pre>
    <b>4.全局配置文件nfinal.json</b>
    <p>
        在该项目默认输出目录中创建nfinal.json。<br />
        一般位于bin\nfinal.json.
    </p>
    <b>5.插件配置文件plug.json</b>
    <p>
        该文件位于该项目输出目录中的Plugs目录下的插件目录中。<br />
        一般位于bin\Plugs\[插件目录]\plug.json<br />
        在该配置文件中需要指定dll插件的文件路径用于该项目加载.
    </p>
</body>
</html>
